package com.itheima.demo.controller;

import com.itheima.demo.dto.LojinDto;
import com.itheima.demo.service.EmpService;
import com.itheima.demo.vo.LoginResultVo;
import com.itheima.demo.vo.Result2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginContrcoller {
    @Autowired
    private EmpService empService;


    @PostMapping
    public Result2<LoginResultVo> login(@RequestBody LojinDto dto){
        LoginResultVo Vo=empService.login(dto);
        return Result2.ok(Vo);
    }
}
